package com.howie.parnote.validator.annotation;

import com.howie.parnote.validator.consumer.PropertyScriptAssertValidator;
import com.howie.parnote.constant.RespMessageConstant;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * <p>Title: parnote</p>
 * <p>
 * Description: parnote
 * </p>
 *
 * @author huangyan
 *         Created by HY on 2015/2/10 0010.
 * @version v1.0.0
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {PropertyScriptAssertValidator.class})
@Documented
public @interface PropertyScriptAssert {
	RespMessageConstant message() default RespMessageConstant.ILLEGAL_ARGUMENT;

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

	String lang();

	String script();

	String alias() default "_this";

	String property();

	@Target({ElementType.TYPE})
	@Retention(RetentionPolicy.RUNTIME)
	@Documented
	public @interface List {
		PropertyScriptAssert[] value();
	}
}
